import sys

def check(s, t, qr):
    if len(s[qr[0]:]) == 0:
        return


if __name__ == '__main__':
    s = sys.stdin.readline().strip()
    t = sys.stdin.readline().strip()
    q = int(sys.stdin.readline().strip())
    query = []
    for _ in range(q):
        query.append(list(map(int, sys.stdin.readline().strip().split())))
    for one in query:
        pass
    print(s)
    print(t)
    print(q)
    print(query)